/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2025-03-03 11:16:07
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2025-03-06 14:59:45
 * @FilePath: \examinationsystem\js\login.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
function switchTab(tabName) {
    const tabs = document.querySelectorAll('.tab-content');
    const buttons = document.querySelectorAll('.tab-button');

    tabs.forEach(tab => {
        tab.classList.remove('active');
    });

    buttons.forEach(button => {
        button.classList.remove('active');
    });

    document.getElementById(tabName).classList.add('active');
    document.querySelector(`.tab-button[onclick="switchTab('${tabName}')"]`).classList.add('active');
}

function showLogin() {
    document.getElementById('login-panel').classList.add('active');
    document.getElementById('register-panel').classList.remove('active');
    document.querySelector('.tool.active').classList.remove('active');
    document.querySelector('.tool:nth-child(1)').classList.add('active');
}

function showRegister() {
    document.getElementById('register-panel').classList.add('active');
    document.getElementById('login-panel').classList.remove('active');
    document.querySelector('.tool.active').classList.remove('active');
    document.querySelector('.tool:nth-child(2)').classList.add('active');
}
